﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category0
{
  public class MT063 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagDefinition U0004;
    private static SwiftTagSubItemDefinition U0005;
    private static SwiftTagDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagSubItemDefinition U0008;
    private static SwiftTagDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagSubItemDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagSubItemDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagSubItemDefinition U0019;
    private static SwiftTagSubItemDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagSubItemDefinition U001C;
    private static SwiftTagSubItemDefinition U001D;

    [Description("Section Number")]
    public Tag202 SectionNumber_202
    {
      get
      {
        return new Tag202((SwiftElement) this, 0, (SwiftDefinitionElement) MT063.U0002);
      }
    }

    [Description("Section Number")]
    public Tag202 Tag202_SectionNumber
    {
      get
      {
        return this.SectionNumber_202;
      }
    }

    [Description("Total Sections")]
    public Tag203 TotalSections_203
    {
      get
      {
        return new Tag203((SwiftElement) this, 0, (SwiftDefinitionElement) MT063.U0004);
      }
    }

    [Description("Total Sections")]
    public Tag203 Tag203_TotalSections
    {
      get
      {
        return this.TotalSections_203;
      }
    }

    [Description("Date Range")]
    public Tag172 DateRange_172
    {
      get
      {
        return new Tag172((SwiftElement) this, 0, (SwiftDefinitionElement) MT063.U0006);
      }
    }

    [Description("Date Range")]
    public Tag172 Tag172_DateRange
    {
      get
      {
        return this.DateRange_172;
      }
    }

    [Description("Non Banking Days")]
    public Tag340[] NonBankingDays_340
    {
      get
      {
        int index = -1;
        List<Tag340> list = new List<Tag340>();
        int count;
        do
        {
          ++index;
          Tag340 tag340 = new Tag340((SwiftElement) this, index, (SwiftDefinitionElement) MT063.U000E);
          count = this.ListTags((SwiftElement) tag340).Count;
          if (count > 0)
            list.Add(tag340);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    [Description("Non Banking Days")]
    public Tag340[] Tag340_NonBankingDays
    {
      get
      {
        return this.NonBankingDays_340;
      }
    }

    public MT063()
      : base(true)
    {
    }

    public MT063(SwiftMessage message)
      : base(message)
    {
    }

    public Tag340 AddNonBankingDays_340()
    {
      return new Tag340((SwiftElement) this, this.NonBankingDays_340.Length, (SwiftDefinitionElement) MT063.U000E)
      {
        Value = string.Empty
      };
    }

    public void RemoveNonBankingDays_340(Tag340 tag)
    {
      this.RemoveTag(tag.GetTag());
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT063.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT063.MessageDefinition = new SwiftMessageDefinition("MT063", "Non-Banking Days List Report");
      MT063.U0002 = new SwiftTagDefinition("SectionNumber_202", "Section Number");
      MT063.U0002.TagName = "{202:";
      MT063.U0003 = new SwiftTagSubItemDefinition("SectionNumber", "Sequential Section Number");
      MT063.U0002.Elements.Add((SwiftDefinitionElement) MT063.U0003);
      MT063.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT063.U0002);
      MT063.U0004 = new SwiftTagDefinition("TotalSections_203", "Total Sections");
      MT063.U0004.TagName = "{203:";
      MT063.U0005 = new SwiftTagSubItemDefinition("TotalSections", "Total number of sections in a multi-section message.");
      MT063.U0004.Elements.Add((SwiftDefinitionElement) MT063.U0005);
      MT063.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT063.U0004);
      MT063.U0006 = new SwiftTagDefinition("DateRange_172", "Date Range");
      MT063.U0006.TagName = "{172:";
      MT063.U0007 = new SwiftTagSubItemDefinition("StartDate", "Start Date");
      MT063.U0006.Elements.Add((SwiftDefinitionElement) MT063.U0007);
      MT063.U0008 = new SwiftTagSubItemDefinition("EndDate", "End Date");
      MT063.U0006.Elements.Add((SwiftDefinitionElement) MT063.U0008);
      MT063.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT063.U0006);
      MT063.U000E = new SwiftTagDefinition("NonBankingDays_340", "Non Banking Days");
      MT063.U000E.TagName = "{340:";
      MT063.U000E.Multiple = true;
      MT063.U000F = new SwiftTagSubItemDefinition("CountryCode", "Country Code");
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U000F);
      MT063.U0010 = new SwiftTagSubItemDefinition("Date1", "Date 1");
      MT063.U0010.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0010);
      MT063.U0011 = new SwiftTagSubItemDefinition("Date2", "Date 2");
      MT063.U0011.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0011);
      MT063.U0012 = new SwiftTagSubItemDefinition("Date3", "Date 3");
      MT063.U0012.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0012);
      MT063.U0013 = new SwiftTagSubItemDefinition("Date4", "Date 4");
      MT063.U0013.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0013);
      MT063.U0014 = new SwiftTagSubItemDefinition("Date5", "Date 5");
      MT063.U0014.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0014);
      MT063.U0015 = new SwiftTagSubItemDefinition("Date6", "Date 6");
      MT063.U0015.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0015);
      MT063.U0016 = new SwiftTagSubItemDefinition("Date7", "Date 7");
      MT063.U0016.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0016);
      MT063.U0017 = new SwiftTagSubItemDefinition("Date8", "Date 8");
      MT063.U0017.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0017);
      MT063.U0018 = new SwiftTagSubItemDefinition("Date9", "Date 9");
      MT063.U0018.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0018);
      MT063.U0019 = new SwiftTagSubItemDefinition("Date10", "Date 10");
      MT063.U0019.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U0019);
      MT063.U001A = new SwiftTagSubItemDefinition("Date11", "Date 11");
      MT063.U001A.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U001A);
      MT063.U001B = new SwiftTagSubItemDefinition("Date12", "Date 12");
      MT063.U001B.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U001B);
      MT063.U001C = new SwiftTagSubItemDefinition("Date13", "Date 13");
      MT063.U001C.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U001C);
      MT063.U001D = new SwiftTagSubItemDefinition("Date14", "Date 14");
      MT063.U001D.Mandatory = false;
      MT063.U000E.Elements.Add((SwiftDefinitionElement) MT063.U001D);
      MT063.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT063.U000E);
    }
  }
}
